
import React from 'react';
import { NavBar } from "antd-mobile/2x"
import PropTypes from "prop-types"
import styles from "./index.module.css"
import { withRouter } from "react-router-dom"

const NavHeader = ({ children, history, back }) => {
    return (
        <NavBar className={styles.navBar} back={back} onBack={() => history.goBack()} >
            {children}
        </NavBar>
    )
}

NavHeader.propTypes = {
    children: PropTypes.string.isRequired
}

export default withRouter(NavHeader);